<?php
class ReportMailForm extends sfFormSymfony
{
  public function configure()
  {
    $this->setWidget('From', new sfWidgetFormInputText());
    $this->setWidget('To', new sfWidgetFormInputText());
    $this->setWidget('Cc', new sfWidgetFormInputText());
    $this->setWidget('Subject', new sfWidgetFormInputText());
    $this->setWidget('Text', new sfWidgetFormTextarea());
    
    
    $this->setValidators(array(
        'To'=>new sfValidatorString(array('max_length' => 512, 'required' => true)),
        'From'=>new sfValidatorString(array('max_length' => 128, 'required' => true)),
        'Cc'=>new sfValidatorString(array('max_length' => 512, 'required' => false)),
        'Subject'=>new sfValidatorString(array('max_length' => 64, 'required' => true)),
        'Text'=>new sfValidatorString(array('max_length' => 1024, 'required' => true)),
        ));                   
    
    $this->widgetSchema->setHelp("To","Insert one ore more mail address, separated by \";\" ");
    $this->widgetSchema->setHelp("Cc","Insert one ore more mail address, separated by \";\" ");
    $this->widgetSchema->setHelp("Text","Insert text before the report");
    
    $this->widgetSchema->setNameFormat('reportMail[%s]');
  }  
}

